package com.hunanwenli.config;

import org.springframework.cloud.client.loadbalancer.LoadBalanced;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.client.RestTemplate;

/**
 * @author wanzhenyu
 * @date 2021/5/21 16:19
 */
@Configuration
public class configBean {
    //配置负载均衡实现RestTemplate
    @Bean
    //配置负载均衡实现RestTemplate
    @LoadBalanced
    public RestTemplate restTemplate(){
        return new RestTemplate();
    }
}
